#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace std;

int main_103()
{
    srand((unsigned int)time(nullptr));
    const int n=20,m=20,x=rand()%30;
    int arr[n]={0};
    for (int i=0; i<n;++i )
    {
        arr[i]=rand()%m;
    }
    sort(arr,arr+n);
    for (int i=0; i<n-1;++i )
    {
        printf("%d ",arr[i]);
    }
    printf("%d\n",arr[n-1]);
    pair<int*,int*> p=equal_range(arr,arr+n,x);
    printf("%d [%d %d]",x,distance(arr,p.first),distance(arr,p.second)-1);
	return 0;
}
